package com.bifang.module.file.common.enums;

public enum ShowFileEnum {
    html("text/html", "html"),
    xml("text/xml", "xml"),
    gif("image/gif", "gif"),
    jpeg("image/jpeg", "jpeg"),
    svg("image/svg+xml", "svg"),
    tif("image/tiff", "tif"),
    wbmp("image/vnd.wap.wbmp", "wbmp"),
    webp("image/webp", "webp"),
    icon("image/x-icon", "icon"),
    jng("image/x-jng", "jng"),
    bmp("image/x-ms-bmp", "bmp"),
    pdf("application/pdf", "pdf"),
    png("image/png", "png"),
    ;
    private String type;
    private String name;

    ShowFileEnum(String type, String name) {
        this.type = type;
        this.name = name;
    }

    public String getType() {
        return this.type;
    }

    public String getName() {
        return this.name;
    }

    public static ShowFileEnum getByType(String type) {

        for (ShowFileEnum typeEnum : values()) {
            if (typeEnum.getType() == type) {
                return typeEnum;
            }
        }
        return null;
    }
}
